package com.gowants.pems.mapper;

import com.gowants.pems.model.EquipmentKnowledge;
import com.gowants.pems.model.EquipmentKnowledgeFile;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EquipmentKnowledgeMapper {

    /**
     * 检索
     * @param record
     * @return
     */
    public List<EquipmentKnowledge> select(@Param("record") EquipmentKnowledge record );

    /**
     * 根据id 检索
     * @param id
     * @return
     */
    public EquipmentKnowledge selectById(String id);

    /**
     * 根据id 检索
     * @param id
     * @return
     */
    public List<EquipmentKnowledgeFile> selectFile(String id);

    /**
     * 插入 设备知识库
     * @param record
     * @return
     */
    public int insert(EquipmentKnowledge record );

    /**
     * 修改设备知识库
     * @param record
     * @return
     */
    public int update(@Param("record") EquipmentKnowledge record );

    /**
     * 删除
     * @param id
     * @return
     */
    public int delete(String id);

    /**
     * 插入文件
     * @param list
     * @return
     */
    public int insertFile(List<EquipmentKnowledgeFile> list);

    /**
     * 根据pid 删除
     * @param pid
     * @return
     */
    public int deleteFileByPid(String pid);

    /**
     * 根据address 删除
     * @param address
     * @return
     */
    public int deleteFileByAddress(String address);

    public int selectByAddress(String address);
}
